Repository navigation
Accept a UTF-8 BOM in eval CSV manifests - #290
Open
codebanditssss wants to merge 1 commit into
Open
codebanditssss wants to merge 1 commit into
codebanditssss wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #288
Summary
assembly evalread CSV manifests asutf-8. When a file starts with a UTF-8 byte-order mark (as Excel's "CSV UTF-8" export writes), the first header becomes\ufeffaudio, so both column auto-detection and--audio-column audiofail with exit code 2.This one-line change opens CSV manifests with
encoding="utf-8-sig". That encoding strips a single leading BOM and otherwise decodes exactly likeutf-8, so existing BOM-less manifests behave the same. JSONL loading is unchanged.Tests
New
tests/test_eval_csv_encoding.pycovers every combination of:--audio-column audio --text-column text;Each case uses quoted headers and a quoted non-ASCII reference that contains a comma (
"héllo, world"), plus a real WAV file. Each case checks two layers:EvalItems.eval --jsoncommand with a fake transcription boundary: exit 0, exactly one transcription call for the local file, 2 words, 0 errors, WER 0.0, and no\ufeffin the output.Before the fix, the 4 BOM cases fail (
Could not find an audio column (columns: \ufeff"audio", text)orThe dataset has no 'audio' column ...) and the 4 BOM-less cases pass. After the fix, all 8 pass. Thetests/test_eval*.pysuite passes (145 tests, including the new cases).Validation
Linux (Fedora 44), Python 3.13.14:
TERM=xterm-256colorandPYTEST_ADDOPTS=--timeout=180../scripts/check.shprintedAll checks passed.: 3782 tests passed, 99.51% branch coverage, diff-cover 100%. The mutation gate generated 0 mutants because the changed line contains only a string constant.assemblyconsole entry point, with a fake key and the SDK boundary stubbed: the BOM manifest now exits 0 with both auto-detected and explicit--audio-column audio, and each run makes one transcription-boundary call, the same as the BOM-less control. The literal\ufeffaudiocolumn name is now rejected, because the real header isaudio.